package com.summer.framework.bill.service.impl;

import com.summer.framework.api.feign.service.admin.UserApiService;
import com.summer.framework.bill.entity.Bill;
import com.summer.framework.bill.mapper.BillMapper;
import com.summer.framework.bill.service.BillService;
import com.summer.framework.common.entity.Users;
import com.summer.framework.common.exception.admin.UserNameNotFoundException;
import com.summer.framework.common.service.BaseServiceImpl;
import com.summer.framework.common.util.UUIDUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @auther: 杨杰
 * @date: 2019/2/21 14:19
 * @description:
 */
@Service
@Slf4j
public class BillServiceImpl extends BaseServiceImpl<BillMapper, Bill> implements BillService {

    @Autowired
    private UserApiService userApiService;


    @Override
    public boolean save(Bill entity) {
        entity.setId(UUIDUtil.create());
        super.save(entity);
        if(entity.getUserId().equals("yangjie")){
            throw new RuntimeException("bill save yangjie 出现异常");
        }
        return true;
    }
}
